import request from '@/sheep/request';

export default {
	// 账号登录
	accountLogin: (data) =>
		request({
			url: '/api/v1/accounts/login',
			method: 'POST',
			data,
			custom: {
				showSuccess: true,
				loadingMsg: '登录中',
				successMsg: '登录成功'
			},
		}),

	// 验证码登录
	smsCodeLogin: (data) =>
		request({
			url: '/api/v1/accounts/sms-code/login',
			method: 'POST',
			data,
			custom: {
				showSuccess: true,
				loadingMsg: '登录中',
				successMsg: '登录成功'
			},
		}),

	// 账号登出
	logout: () =>
		request({
			url: '/api/v1/accounts/logout',
			method: 'POST',
			custom: {
				showSuccess: true,
				loadingMsg: '退出中',
				successMsg: '退出成功'
			},
		}),

	// 发送验证码
	sendSmsCode: (data) =>
		request({
			url: "/api/v1/accounts/sms-code/" + data.phone,
			method: 'GET',
			custom: {
				showSuccess: true,
				loadingMsg: '验证码发送中',
				successMsg: '发送成功'
			},
		}),
	// 发送验证码
	profile: () =>
		request({
			url: "/api/v1/accounts/current",
			method: 'GET'
		})
}